home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / windows / wdj1096.zip / ZOLMAN.ZIP / ZVBDLG.ZIP / ZVBDLG.CPP < prev    next >
C/C++ Source or Header  |  1996-01-16  |  1KB  |  52 lines

  1. /*
  2.     File: ZVBDlg.cpp
  3.     Author: Raja
  4.     Date: Jan 16, 1996
  5.  
  6.     ZVBDialog inherits from CDialog and supports one
  7.     additional functionality: VBX Events are first given back to the
  8.     controls to give first crack at processing.
  9. */
  10.  
  11. #include "stdafx.h"
  12. #include "zvbdlg.h"
  13.  
  14. #ifdef _DEBUG
  15. #undef THIS_FILE
  16. static char BASED_CODE THIS_FILE[] = __FILE__;
  17. #endif
  18.  
  19. IMPLEMENT_DYNAMIC (ZVBDialog, CDialog)
  20.  
  21. #define new DEBUG_NEW
  22.  
  23. BEGIN_MESSAGE_MAP(ZVBDialog, CDialog)
  24.     //{{AFX_MSG_MAP(ZVBDialog)
  25.     ON_MESSAGE(WM_VBXEVENT, OnVBXEvent)
  26.     //}}AFX_MSG_MAP
  27. END_MESSAGE_MAP()
  28.  
  29.  
  30. /************************************************************************/
  31. // Raja 22/12/1995
  32. // OnVBXEvent - WM_VBXEVENT handler.
  33. // Whenever a VBX event comes our way, give it back to the child first,
  34. // using the MFC standard way (OnChildNotify). Then call the base class
  35. // handler.
  36. /************************************************************************/
  37.  
  38. LRESULT ZVBDialog::OnVBXEvent(WPARAM wParam, LPARAM lParam)
  39. {
  40.     ASSERT(wParam != 0);    // 0 control IDs are not allowed !
  41.     CWnd *pWnd = GetDlgItem (wParam);
  42.     ASSERT (pWnd);
  43.     if (pWnd) {
  44.         ASSERT (pWnd->IsKindOf (RUNTIME_CLASS (CVBControl)));
  45.         if (pWnd->SendChildNotifyLastMsg ())
  46.             return TRUE;        // eaten by child
  47.     }
  48.     return CDialog::OnVBXEvent (wParam, lParam);
  49. }
  50.  
  51.  
  52.